Core Java - Interview Questions and Answers for 'Java 9 module' - 15 question(s) found - Order By Rating Q1. How Java 9 would help resolve NoClassDefFoundError through it's modularity ? Core Java
Ans. Java 9 would provide an error at compile time if there are different modules with the same package mapped to the same class loader and hence would provide a compile time check for this issue.
NoClassDefFoundError exists because of ambiguity at realtime because of multiple versions of same package / class exist. As Java 9 would provide a compile time check for it through clearly defined dependencies and exports and a check on duplicate packages being loaded by single class loader, it will fix the problem. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q2. What is the default setting for Automatic modules regarding exporting packages and reading modules ? Core Java
Ans. As one purpose of automatic module is to provide backward compatibility with the module less dependencies, automatic modules exports all packages and include all other modules. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q3. How does Java 9 provides backward compatibility with libraries that haven't published themselves as modules ? Core Java
Ans. Though Automatic modules. Any JAR on the module path without module descriptor ends up as automatic module Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q4. How does modularity in Java 9 facilitates better encapsulation ? Core Java
Ans. By providing dependencies , services and exports explicitly Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q5. What are the qualified and unqualified packages ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q6. Does Java 9 allows same package within different modules ? Core Java
Ans. Yes it allows if the modules are mapped to different class loaders. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java 9 modules Q7. What is the use of Requires, Exports, Opens and provides within Module Descriptor ? Core Java
Ans. Requires specifies the dependencies for the module, i.e the modules required for this module to function.
Exports specifies the packages exported by the module.
Opens specifies the packages opened by the module.
Provides specifies the services provided by the module
Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q8. Difference between named and unnamed modules ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modulesAns. A Module layer is created from a graph of modules and is a function that maps modules to their class loaders. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q11. Do we need different class loaders for different modules in Java 9 ? Core Java
Ans. No, We can use the same class loader. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q12. How Java 9 helps in building light weight applications ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q13. How modules are different than packages in Java 9 ? Core Java
Ans. Modules are independently build units and contains multiple packages. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q14. What is the concept of modules in Java 9 ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules Q15. Why do we have multiple core java jars in java 9 ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 9  java modules   java 9 modules